home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-src.lha / gcc-2.6.3 / config / netbsd.h < prev    next >
C/C++ Source or Header  |  1994-09-09  |  6KB  |  185 lines

  1. /* Look for the include files in the system-defined places.  */
  2.  
  3. #undef GPLUSPLUS_INCLUDE_DIR
  4. #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
  5.  
  6. #undef GCC_INCLUDE_DIR
  7. #define GCC_INCLUDE_DIR "/usr/include"
  8.  
  9. #undef INCLUDE_DEFAULTS
  10. #define INCLUDE_DEFAULTS        \
  11.   {                    \
  12.     { GPLUSPLUS_INCLUDE_DIR, 1, 1 },    \
  13.     { GCC_INCLUDE_DIR, 0, 0 },        \
  14.     { 0, 0, 0 }                \
  15.   }
  16.  
  17.  
  18. /* Under NetBSD, the normal location of the `ld' and `as' programs is the
  19.    /usr/bin directory.  */
  20.  
  21. #undef MD_EXEC_PREFIX
  22. #define MD_EXEC_PREFIX "/usr/bin/"
  23.  
  24. /* Under NetBSD, the normal location of the various *crt*.o files is the
  25.    /usr/lib directory.  */
  26.  
  27. #undef MD_STARTFILE_PREFIX
  28. #define MD_STARTFILE_PREFIX "/usr/lib/"
  29.  
  30.  
  31. /* Provide a CPP_SPEC appropriate for NetBSD.  Current we just deal with
  32.    the GCC option `-posix'.  */
  33.  
  34. #undef CPP_SPEC
  35. #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
  36.  
  37. /* Provide an ASM_SPEC appropriate for NetBSD.  Currently we only deal
  38.    with the options for generating PIC code.  */
  39.  
  40. #undef ASM_SPEC
  41. #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
  42.  
  43. /* Provide a LIB_SPEC appropriate for NetBSD.  Just select the appropriate
  44.    libc, depending on whether we're doing profiling.  */
  45.  
  46. #undef LIB_SPEC
  47. #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
  48.  
  49. /* Provide a LINK_SPEC appropriate for NetBSD.  Here we provide support
  50.    for the special GCC options -static, -assert, and -nostdlib.  */
  51.  
  52. #undef LINK_SPEC
  53. #define LINK_SPEC \
  54.   "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
  55.  
  56.  
  57. /* We have atexit(3).  */
  58.  
  59. #define HAVE_ATEXIT
  60.  
  61. /* Implicit library calls should use memcpy, not bcopy, etc.  */
  62.  
  63. #define TARGET_MEM_FUNCTIONS
  64.  
  65. /*
  66.  * Some imports from svr4.h in support of shared libraries.
  67.  * Currently, we need the DECLARE_OBJECT_SIZE stuff.
  68.  */
  69.  
  70. /* Define the strings used for the special svr4 .type and .size directives.
  71.    These strings generally do not vary from one system running svr4 to
  72.    another, but if a given system (e.g. m88k running svr) needs to use
  73.    different pseudo-op names for these, they may be overridden in the
  74.    file which includes this one.  */
  75.  
  76. #undef TYPE_ASM_OP
  77. #undef SIZE_ASM_OP
  78. #undef WEAK_ASM_OP
  79. #define TYPE_ASM_OP    ".type"
  80. #define SIZE_ASM_OP    ".size"
  81. #define WEAK_ASM_OP    ".weak"
  82.  
  83. /* The following macro defines the format used to output the second
  84.    operand of the .type assembler directive.  Different svr4 assemblers
  85.    expect various different forms for this operand.  The one given here
  86.    is just a default.  You may need to override it in your machine-
  87.    specific tm.h file (depending upon the particulars of your assembler).  */
  88.  
  89. #undef TYPE_OPERAND_FMT
  90. #define TYPE_OPERAND_FMT    "@%s"
  91.  
  92. /* Write the extra assembler code needed to declare a function's result.
  93.    Most svr4 assemblers don't require any special declaration of the
  94.    result value, but there are exceptions.  */
  95.  
  96. #ifndef ASM_DECLARE_RESULT
  97. #define ASM_DECLARE_RESULT(FILE, RESULT)
  98. #endif
  99.  
  100. /* These macros generate the special .type and .size directives which
  101.    are used to set the corresponding fields of the linker symbol table
  102.    entries in an ELF object file under SVR4.  These macros also output
  103.    the starting labels for the relevant functions/objects.  */
  104.  
  105. /* Write the extra assembler code needed to declare a function properly.
  106.    Some svr4 assemblers need to also have something extra said about the
  107.    function's return value.  We allow for that here.  */
  108.  
  109. #undef ASM_DECLARE_FUNCTION_NAME
  110. #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)            \
  111.   do {                                    \
  112.     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                \
  113.     assemble_name (FILE, NAME);                        \
  114.     putc (',', FILE);                            \
  115.     fprintf (FILE, TYPE_OPERAND_FMT, "function");            \
  116.     putc ('\n', FILE);                            \
  117.     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));            \
  118.     ASM_OUTPUT_LABEL(FILE, NAME);                    \
  119.   } while (0)
  120.  
  121. /* Write the extra assembler code needed to declare an object properly.  */
  122.  
  123. #undef ASM_DECLARE_OBJECT_NAME
  124. #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)            \
  125.   do {                                    \
  126.     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                \
  127.     assemble_name (FILE, NAME);                        \
  128.     putc (',', FILE);                            \
  129.     fprintf (FILE, TYPE_OPERAND_FMT, "object");                \
  130.     putc ('\n', FILE);                            \
  131.     size_directive_output = 0;                        \
  132.     if (!flag_inhibit_size_directive && DECL_SIZE (DECL))        \
  133.       {                                    \
  134.     size_directive_output = 1;                    \
  135.     fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                \
  136.     assemble_name (FILE, NAME);                    \
  137.     fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL)));    \
  138.       }                                    \
  139.     ASM_OUTPUT_LABEL(FILE, NAME);                    \
  140.   } while (0)
  141.  
  142. /* Output the size directive for a decl in rest_of_decl_compilation
  143.    in the case where we did not do so before the initializer.
  144.    Once we find the error_mark_node, we know that the value of
  145.    size_directive_output was set
  146.    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
  147.  
  148. #undef ASM_FINISH_DECLARE_OBJECT
  149. #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)     \
  150. do {                                     \
  151.      char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);             \
  152.      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)         \
  153.          && ! AT_END && TOP_LEVEL                     \
  154.      && DECL_INITIAL (DECL) == error_mark_node             \
  155.      && !size_directive_output)                     \
  156.        {                                 \
  157.      size_directive_output = 1;                     \
  158.      fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);             \
  159.      assemble_name (FILE, name);                     \
  160.      fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
  161.        }                                 \
  162.    } while (0)
  163.  
  164. /* This is how to declare the size of a function.  */
  165.  
  166. #undef ASM_DECLARE_FUNCTION_SIZE
  167. #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)            \
  168.   do {                                    \
  169.     if (!flag_inhibit_size_directive)                    \
  170.       {                                    \
  171.         char label[256];                        \
  172.     static int labelno;                        \
  173.     labelno++;                            \
  174.     ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);        \
  175.     ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);        \
  176.     fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                \
  177.     assemble_name (FILE, (FNAME));                    \
  178.         fprintf (FILE, ",");                        \
  179.     assemble_name (FILE, label);                    \
  180.         fprintf (FILE, "-");                        \
  181.     assemble_name (FILE, (FNAME));                    \
  182.     putc ('\n', FILE);                        \
  183.       }                                    \
  184.   } while (0)
  185.